import Vue from 'vue'

import Router from 'vue-router'
Vue.use(Router);

// 引入ElementUI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI);

// 数字变化插件
import VueCountUp from 'vue-countupjs';
Vue.use(VueCountUp);

// 引入websocket
// import VueWebsocket from "vue-websocket";
// Vue.use(VueWebsocket, "ws://127.0.0.1:8888/socketServer/1", {
//     reconnection: false
// });

import Vuex  from 'vuex'
Vue.use(Vuex);

import Home from '@/components/el-home'

import EleModule from "@/store/eleModule";

import Login from "@/view/Login";
import StudentHome from "@/view/StudentHome";
import StuClass from "@/components/student/el-class"
import StuExam from "@/components/student/el-exam"
import StuResult from "@/components/student/el-result"

import UserList from "@/view/user/user-list";
import UserAdd from "@/view/user/user-add";
import User from "@/view/user/user";
import Feedback from "@/view/feedback/feedback";
import FileResources from "@/view/fileResources/file-resources";

import QuestionAdd from "@/view/question/question-add";

import Chat from "@/components/chat/el-chat";

import Schedule from "@/components/schedule/schedule";
import EmporiumIndex from "@/components/bootstrap/emporiumIndex";
import Canvas from "@/components/canvas/canvas";
import Code from "@/components/code/el-code";
import Demo from "@/components/demo";
import Calendar from "@/components/el-calendar";

const vuex_store = new Vuex.Store({
    modules:{
        ele: EleModule
    }
});

export default new Router({
    routes: [
        {path: '/', redirect: "/login"},
        // {path: '/', redirect: "/shopping"},
        {path: '/login',name: 'login',component: Login},
        {path: '/student',name: 'studentHome',component: StudentHome, children: [
                {path: "class", name: "class", component: StuClass,  meta: {keepAlive: true}},
                {path: "exam", name: "exam", component: StuExam, meta: {keepAlive: true}},
                {path: "result", name: "result", component: StuResult, meta: {keepAlive: true}},
            ]},
        {path: '/home', name: 'home', component: Home, children: [
                {path: "user", redirect: "/user/list", name: "user", component: User, children: [
                        {path: "list", name: "userList", component: UserList},
                        {path: "add", name: "addUser", component: UserAdd},
                    ]},
                {path: "feedback", name: "feedback", component: Feedback},
                {path: "file", name: "file-resources", component: FileResources},
            ]},
        {path: '/question',name: 'questionAdd',component: QuestionAdd},
        {path: '/chat',name: 'chat',component: Chat},
        {path: '/schedule',name: 'schedule',component: Schedule},
        {path: '/canvas',name: 'canvas',component: Canvas},
        {path: '/code',name: 'code',component: Code},
        {path: '/demo',name: 'demo',component: Demo},
        {path: '/calendar',name: 'calendar',component: Calendar},
        // {path: '/shopping',name: 'emporiumIndex',component: EmporiumIndex},

    ]
})
